package com.lagou.service.impl;

import com.lagou.entity.Tbuser;
import com.lagou.repository.TbuserRepository;
import com.lagou.service.TbuserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author mcl
 * @date 2021/11/13 13:22
 * @description
 */
@Service
public class TbuserServiceImpl implements TbuserService {
    @Autowired
    private TbuserRepository tbuserRepository;

    @Override
    public List<Tbuser> findByTbUser(Tbuser tbuser) {
        Example<Tbuser> tbuserExample = Example.of(tbuser);
        return tbuserRepository.findAll(tbuserExample);
    }

    @Override
    public void save(Tbuser tbuser) {
        tbuserRepository.save(tbuser);
    }
}
